extends "../i_bangled/i_bangled.gd"
var flag 
func init():
	.init()
	name = "毒手镯·噬"
	resetdata()
	info = "万毒体：被攻击时,33%使攻击者附加一层<毒种>和免疫所有和毒有关的buff[免疫持续4秒，cd：6秒]；<毒种>爆发额外增加33%物攻\n" + info

func _connect():
	._connect()
	masCha.connect("onHurt",self,"addbing")
	masCha.connect("onBattleStart",self,"resetflag")

func resetflag():
	flag = 1

func _upS():
	._upS()
	if flag:return
	cnt2 += 1
	if cnt2 == 6:
		cnt2 = 0
		flag = 1

func addbing(atkinfo):
	if atkinfo.isMiss || atkinfo.atkType == Chara.AtkType.EFF:return
	if sys.rndPer(33):
		var lf = 6
		if masCha.hasBuff("DY"):lf = 10
		var bf = atkinfo.atkCha.hasBuff("b_duzhong")
		if !bf:
			atkinfo.atkCha.addBuff(ctrl.b_duzhong.new(lf,1))
		else:
			bf.cnt += 1
			bf.life += lf
			if bf.cnt >= 9:
				bf.isDel = true
				masCha.hurtChara(atkinfo.atkCha,masCha.att.atk * 1.88,Chara.HurtType.REAL,Chara.AtkType.EFF)
		if flag:
		   flag = 0
		   masCha.addBuff(MYD.new(1)) 